package com.jrx.anytxn.customer.mapper.ext;

import com.jrx.anytxn.customer.entity.TlMarketingRecord;
import com.jrx.anytxn.customer.mapper.base.TlMarketingRecordMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 营销数据记录表mapper扩展
 *
 * @author zcc
 * date 2020/12/03
 * @version V1.0
 **/
public interface ExtTlMarketingRecordMapper extends TlMarketingRecordMapper {

    /**
     * 批量 - 根据状态查询营销记录
     * @param sumStatus
     * @return
     */
    List<TlMarketingRecord> selectBySumStatus(@Param(value = "sumStatus") String sumStatus, @Param(value = "grayVersion") String grayVersion);

    /**
     * 批量-批量更新营销记录（用于批量）
     * @param updateLogList
     * @return
     */
    int batchUpdateLogForBatch(List<TlMarketingRecord> updateLogList);

    /**
     * 根据业务日期查询
     * @param businessDate
     * @return
     */
    List<TlMarketingRecord> selectByBatch(@Param("businessDate") Date businessDate);

    /**
     * 根据业务日期查询当日产生营销记录的业务员编号
     * @param businessDate
     * @return
     */
    List<String> selectRecomderByBatch(@Param("businessDate") Date businessDate);

    /**
     * 根据业务日期、推荐员编号、营销阶段查询当日产生营销记录的汇总信息
     * @param businessDate
     * @return
     */
    Map selectSumByBusDateAndRecomderAndStep(@Param("businessDate") Date businessDate,
                                             @Param("recommenderCode") String recommenderCode,
                                             @Param("step") String step);

}
